<?php
session_name("Profile");
session_start();
//$content.= '<P>Profile Session ID:'.$_COOKIE['PHPSESSID'].'</P><br />';
$p_img = $_SESSION['p_img'];
$p_on_profile = $_SESSION['p_on_profile'];
$p_profile_id = $_SESSION['p_profile_id'];

$this_page = this_page();

if($this_page != '/profile.php' ||
   $_GET['id'] != $p_profile_id){
   	$p_on_profile = false;
   }

if(isset($_SESSION['p_on_profile']) && !$p_on_profile){
	session_name("Profile");
	unlink("$p_img");
	//session_unset();
	//session_destroy();
	unset($p_img);
	unset($p_on_profile);
	unset($p_profile_id);
	unset($_SESSION['p_img']);
	unset($_SESSION['p_on_profile']);
	unset($_SESSION['p_profile_id']);
}

?>